<?php
/*********************************
	作者：wzxaini9@vip.qq.com
	时间：2016-06-02
	描述：操作日志
**********************************/
namespace Admin\Controller;
use Common\Controller\AdminbaseController;
class JournalController extends AdminbaseController {
	function _initialize() {
		parent::_initialize();
	}
	public function index(){
    	$this->_list();
    }

	public function getArr( $file ){
        if(!file_exists( $file )){
            return false;//判断文件是否存在
        }
        $arr = file($file);
        $res = array();
        foreach($arr as $value){
            $value = trim( $value );
            if( empty($value)){
                continue;//去除空行
            }
			$value=explode("|=|", str_replace(array("\r\n", "\r", "\n"), "", $value));
			$res[] = $value;//确定第二维度
		}
        return $res;
    }
	public function _list(){
		if($_POST['time']){
			$date=$_POST['time'];
		}else{
			$date=date('Y-m-d');
		}
		$filename="data/journal/".$date.".log";
		$file = $this->getArr($filename);
		$this->assign("content",$file);
		$this->assign("formpost",$date);
		$this->assign("num",$num);
		$this->display();
	}
}
